# coding: utf-8

import sys
from RobotProxy import app


def CbNotify(strType, strMsg):
    print(strType, strMsg)
    pass


app.CbNotify = CbNotify  # this is for Notify, can be none


def On_Init():
    print("On_Init")
    app.Audio.TtsPlay("你好啊，我是小薇机器人，有什么可以为你服务的吗?")
    pass


nIndex = 0


def On_Run():
    sys.stdout.flush()
    global nIndex
    nIndex += 1
    print("On_Run", nIndex)
    if nIndex > 50:
        return False
    return True


def On_Stop():
    print("On_Stop")
    app.Audio.TtsPlay("脚本结束，下次再见!")
    pass


if __name__ == "__main__":
    print("Wait For Shutdown...")
    app.Comm.waitForShutdown()
